from django.db import models

# Create your models here.
class BookInfo(models.Model):
	name = models.CharField(max_length=10,verbose_name='书籍名称')

	def __str__(self):
		return self.name
	class Meta:
		verbose_name = '书籍管理'
		verbose_name_plural = verbose_name

class PeopleInfo(models.Model):
	name = models.CharField(max_length=10,verbose_name='人物名称')
	gender = models.BooleanField(verbose_name='性别')
	book = models.ForeignKey(BookInfo,on_delete=models.CASCADE,verbose_name='所属书籍')

	def __str__(self):
		return self.name

	class Meta:
		verbose_name = '人物管理'
		verbose_name_plural = verbose_name
